//
//  ShowTipView.m
//  LXLocationRelated
//
//  Created by Livespro on 2017/10/23.
//  Copyright © 2017年 Livesxu. All rights reserved.
//

#import "ShowTipView.h"

@interface ShowTipView()

@property (nonatomic, strong) UILabel *titleLabel;

@property (nonatomic, strong) UILabel *dataLabel;

@end

@implementation ShowTipView

- (instancetype)initWithFrame:(CGRect)frame Title:(NSString *)title;{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self addSubview:self.titleLabel];
        [self addSubview:self.dataLabel];
        self.titleLabel.text = title;
        
    }
    return self;
}

- (UILabel *)titleLabel{
    if (!_titleLabel) {
        
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, self.bounds.size.width, 10)];
        _titleLabel.font = [UIFont systemFontOfSize:8];
        _titleLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _titleLabel;
}

- (UILabel *)dataLabel{
    if (!_dataLabel) {
        
        _dataLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 10, self.bounds.size.width, 15)];
        _dataLabel.font = [UIFont systemFontOfSize:12];
        _dataLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _dataLabel;
}


- (void)setDataRenew:(double)dataRenew{
    
    _dataRenew = dataRenew;
    
    self.dataLabel.text = [NSString stringWithFormat:@"%.3f",_dataRenew];
    
}


@end
